Logic Gates
Logic Gates are the basic units used to make more complex circuitry. One or more inputs, each being either 1 (HIGH, or "on") or 0 (LOW or "off") are fed to the gate, which then processes the input(s) into one or more outputs. In Minecraft, the NOT and OR gates are particularly important since they are the basic components that form almost all other logic gates. NOT Gate The NOT gate, also known as the inverter, will receive an input, which then will be "inverted", meaning the output will be the opposite of the input. The most common way of implementing this in Minecraft is by using a Redstone Torch, which when powered (by powering the block it is attached to), turns off, making it stop supplying power. This can also be done with a Redstone Comparator on subtraction mode, by connecting the rear to any power source or a Chest filled with items, and one of the sides to the input. This is very useful when building torchless circuits. torch not gate.png|Torch-based NOT gate with a 0 input. Comparator not gate.png|Comparator design with a chest full of items. Any source of power could be used in place of the chest, but using a chest sometimes is useful to avoid powering wires that shouldn't be powered. Note that the amount of items will determine the strength of the signal. OR Gate The OR gate outputs 1 whenever one or more inputs are 1. This is the easiest gate to implement, potentially being as simple as joining both inputs together with redstone wire. However, it must be noted that this can be dangerous in some cases, since it could cause unwanted signal to flow back. To prevent this, diodes can be used to force signal to flow in one direction. or gate.png|Simplest OR gate, made simply by joining the two inputs together. repeater or gate.png|OR gate which uses repeaters to prevent signal from flowing back. slab or gate.png|OR gate with a slab as a diode. NOR Gate The NOR gate outputs 1 if and only if all inputs are 0, anything else outputting 0. It is an OR Gate with an inverted output. nor gate.png|NOR gate design with a torch. comparator nor gate.png|NOR gate using a comparator on subtraction mode. AND Gate The AND gate outputs 1 only when all inputs are 1. In Minecraft, this is usually achieved with the following equivalent expression: (NOT A) NOR (NOT B) and gate.png|AND gate implemented using NOT and NOR gates. NAND Gate The NAND gate only outputs 0 when all inputs are 1. It can also be seen as: (NOT A) OR (NOT B) nand gate.png|NAND gate. Note that it is the same design as the torch-based AND gate, with the exception of a missing torch in the "middle", as there's no need to invert the output. comparator nand gate.png|Comparator-based NAND gate. It has the same logic as the torch design. XOR Gate The XOR Gate, also known as the Exclusive OR Gate, outputs 1 whenever the number of 1 inputs is odd. Because of this property, it is widely used in binary adders. There are several ways to build an XOR gate with other logical gates. For more information, visit XOR gate's main article . xor.png|XOR design commonly used to teach ripple-carry adder. stackable xor.png|XOR gate commonly used due to its horizontal stackability. comparator xor.png|Fastest XOR design possible (1 tick), vertically stackable. The base of CC adders.